package abstractfactory.factory;

/**
 * @ClassName FactoryProducer
 * @Description TODO
 * @Author 马继斌
 * @Email 1423553596@qq.com
 * @Date 18-8-29 上午5:52
 **/
public class FactoryProducer {
    /**
     *
     * @param choice 工厂类型
     * @return
     */
    public static AbstractFactory getFactory(String choice){
        if(choice == null){
            return null;
        }
        if(choice.equalsIgnoreCase("SHAPE")){
            return new ShapeFactory();
        }else if(choice.equalsIgnoreCase("COLOR")){
            return new ColorFactory();
        }
        return null;
    }
}
